<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>

	<head>
		<meta name="renderer" content="webkit|ie-comp|ie-stand">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta charset='utf-8'>
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<title>首页</title>
		<meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<meta http-equiv="Cache-Control" content="no-siteapp">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="mobile-web-app-capable" content="yes">
		<meta name="format-detection" content="telephone=no">
		<meta name="keywords" content="">
		<meta name="description" content="">
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/page.css" />
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/base.css" />
		<script src="${pageContext.request.contextPath }/js/jquery.min.js" type="text/javascript"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.SuperSlide.2.1.js"></script>		
		<script type="text/javascript" src="${pageContext.request.contextPath }/js/ajax/ajax.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath }/js/common.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath }/js/ajax/addShoppingCar.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.cookie.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath }/js/ajax/jquery-session.js"></script>
	

	
	</head>
	
	<body>
		<!--header star-->
		<div class="header clearfix">			
			<div class="top clearfix">
				<div class="topctent clearfix">
					<div class="left clearfix fl">
						公告：您好，欢迎登录北京椿龄文化发展有限公司
					</div>
					<div class="right clearfix fr">
						<div class="zuo clearfix fl">
							<ul class="clearfix fl">
								<li>
									<span class="fl">欢迎</span>
									<a href="${pageContext.request.contextPath }/grxx.jsp" class="fl" id="usercode">
									<c:out value="${sessionScope.userCode }"/></a>
									<span class="fl">进入商城</span>
								</li>
								<li>
									<a href="${pageContext.request.contextPath }/register.jsp">
										免费注册
									</a>
								</li>
								<li>
									<a href="${pageContext.request.contextPath }/settled.jsp">
										艺术家入驻
									</a>
								</li>
							</ul>
						</div>						
						<div class="shopcar-btn clearfix fl">
							<a href="${pageContext.request.contextPath }/shopping.jsp" class="box-s">
								购物车（<span id="carnum">0</span>）
							</a>
						</div>
						<div class="fenxiang clearfix fl">
							<span class="fl">分享到：</span>
							<ul class="clearfix fl">
								<li><a href="#"><img src="${pageContext.request.contextPath }/img/sina.png"/></a></li>
								<li><a href="#"><img src="${pageContext.request.contextPath }/img/qq.png"/></a></li>
								<li><a href="#"><img src="${pageContext.request.contextPath }/img/wechat.png"/></a></li>
							</ul>
						</div>
					</div>					
				</div>
			</div>			
			<div class="bottom clearfix">
				<div class="logo clearfix">
					<a href="${pageContext.request.contextPath }/index.jsp"></a>
				</div>
				<div class="search clearfix fr ra5">
					<input type="text" class="fl" name="" id="" value="" placeholder="请输入您要搜索的内容" />
					<input type="button" name="" id="" value="搜索" class="fl box-s" />
				</div>
			</div>
		</div>
		<!--header end-->
		
		<!--navbar star-->
		<div class="navbar clearfix">
			<div class="content clearfix">
				<ul>
					<li class="cur"><a href="${pageContext.request.contextPath }/index.jsp">首页</a></li>
					<li><a href="${pageContext.request.contextPath }/special.jsp">专场</a></li>
					<li><a href="${pageContext.request.contextPath }/mall.jsp">商城</a></li>
					<li><a href="${pageContext.request.contextPath }/artist.jsp" >艺术家</a></li>
				</ul>
			</div>
		</div>
		<!--navbar end-->
		<!--banner star-->
		<div class="banner">		
			<div class="bd">
				<ul>
					<li style="background:url(upload/banner.jpg) #194982 center 0 no-repeat;"><a href="#"></a></li>
					<li style="background:url(upload/banner2.jpg) #15181e center 0 no-repeat;"><a href="#"></a></li>
					<li style="background:url(upload/banner3.jpg) #0b0b0b center 0 no-repeat;"><a href="#"></a></li>
					<li style="background:url(upload/banner4.jpg) #000000 center 0 no-repeat;"><a href="#"></a></li>
					<li style="background:url(upload/banner5.jpg) #04304b center 0 no-repeat;"><a href="#"></a></li>
				</ul>
			</div>
			<div class="hd"><ul></ul></div>
		</div>
		<!--banner end-->
		
		<!--recom star-->
		<div class="recom clearfix">
			<div class="content clearfix">
				<div class="recom-tit clearfix">
					<p class="engtit ta-center">
						RECOMMENDS
					</p>
					<div class="middle clearfix">
						<span class="line"></span>
						<span class="wenzi">今日推荐</span>
						<span class="line"></span>
					</div>
					
					<p class="fu-tit">
						好作品无需多说 你会由心的看清它的诉说
					</p>
					<input type="hidden" value="" id="hiddenInfo">
				</div>
				<div class="bottom clearfix box-s">
					<div class="left clearfix fl">
						<div class="listone clearfix fl">
							<a href="#">
								<!--备注：第一张图 宽度：418像素，高度：710像素-->
								<div class="tu clearfix">
									<img id="fimg0" src="" width="437px;" height="710px;"/>
								</div>
								<div class="listxia clearfix ta-center">
									<h2>
										<p>
											<span id="Aname0">孙瑾晨</span>
											<span id="price0">00.<samp>00</samp></span>
										</p>
									</h2>
								</div>
							</a>
						</div>
						<div class="listone listtwo clearfix fl">
							<a href="#">
								<!--备注：第二张图 宽度：438像素，高度：376像素-->
								<div class="tu clearfix">
									<img id="fimg1" src="" width="530px;" height="637px;"/>
									<span></span>
								</div>
								<div class="listxia clearfix ta-center">
									<h2>
										<p>
											<span id="Aname1"></span>
											<span id="price1">00.<samp>00</samp></span>
										</p>
									</h2>
								</div>
							</a>
						</div>
					</div>
					<div class="right clearfix fr">
						<div class="listone listthree clearfix fl">
							<a href="#">
								<!--备注：第三张图 宽度：530像素，高度：638像素-->
								<div class="tu clearfix">
									<img id="fimg2" src="" width="437px;" height="375px;"/>
									<span></span>
								</div>
								<div class="listxia clearfix ta-center">
									<h2>
										<p>
											<span id="Aname2"></span>
											<span id="price2">00.<samp>00</samp></span>
										</p>
									</h2>
								</div>
							</a>
						</div>
						
						<div class="listone listfour clearfix fr">
							<a href="#">
								<!--备注：第四张图 宽度：438像素，高度：480像素-->
								<div class="tu clearfix">
									<img id="fimg3" src="" width="438px;" height="480px;"/>
									<span></span>
								</div>
								<div class="listxia clearfix ta-center">
									<h2>
										<p>
											<span id="Aname3"></span>
											<span id="price3">00.<samp>00</samp></span>
										</p>
									</h2>
								</div>
							</a>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--recom end-->
		
		<!--choice star-->
		<div class="choice clearfix">
			<div class="bgdian"></div>
			<div class="recom-tit clearfix">
				<p class="engtit ta-center">
					SHOPPING MALL
				</p>
				<div class="middle clearfix">
					<span class="line"></span>
					<span class="wenzi">商城精选</span>
					<span class="line"></span>
				</div>
				<p class="fu-tit">
					画品丰富多类 抽象 印象 自然 城市皆有
				</p>
			</div>
			<div class="content clearfix box-s" id="choice-box">
				<a href="#" class="choice-more">MORE+</a>
				<div class="list clearfix transition addPictrue">
				<div class="tu clearfix">
						<img src="" id="fimg4"/>
						<span></span>
						
						<div class="ycang clearfix">
							<samp class="opa8"></samp>
							<div class="nr clearfix">
								<!--注意：当下方li中添加class名为cur的时候为选中的时候样式-->
								<ul>
									<li class="box-s transition"onclick="addcollct()">收藏</li>
									<li class="box-s transition" onclick="addShoppingCar(4)">购物车</li>
								</ul>
							</div>								
						</div>
					</div>
					<div class="xia clearfix box-s">
						<p class="bt over" id="Aname4">
							尹毅
						</p>
						<div class="price clearfix">
								<span class="f1" id="price4">￥00.00</span>
							<a href="javaScript:;" onclick="shopping(4)" class="goumai fr ra3 transition shopping">立即购买</a>
						</div>
					</div>
				</div>
				<div class="list clearfix transition addPictrue">
				<div class="tu clearfix">
						<img src="" id="fimg5"/>
						<span></span>
						
						<div class="ycang clearfix">
							<samp class="opa8"></samp>
							<div class="nr clearfix">
								<!--注意：当下方li中添加class名为cur的时候为选中的时候样式-->
								<ul>
									<li class="box-s transition"onclick="addcollct()">收藏</li>
									<li class="box-s transition" onclick="addShoppingCar(5)">购物车</li>
								</ul>
							</div>								
						</div>
					</div>
					<div class="xia clearfix box-s">
						<p class="bt over" id="Aname5">
							尹毅画作
						</p>
						<div class="price clearfix">
						<span class="f1" id="price5">￥00.00</span>
							<a href="javaScript:;" onclick="shopping(5)" class="goumai fr ra3 transition shopping">立即购买</a>
						</div>
					</div>
				</div>
				<div class="list clearfix transition addPictrue">
				<div class="tu clearfix">
						<img src="" id="fimg6"/>
						<span></span>
						
						<div class="ycang clearfix">
							<samp class="opa8"></samp>
							<div class="nr clearfix">
								<!--注意：当下方li中添加class名为cur的时候为选中的时候样式-->
								<ul>
									<li class="box-s transition"onclick="addcollct()">收藏</li>
									<li class="box-s transition" onclick="addShoppingCar(6)">购物车</li>
								</ul>
							</div>								
						</div>
					</div>
					<div class="xia clearfix box-s">
						<p class="bt over" id="Aname6">
							尹毅画作
						</p>
						<div class="price clearfix">
							<span class="f1" id="price6">￥00.00</span>
							<a href="javaScript:;" onclick="shopping(6)" class="goumai fr ra3 transition shopping">立即购买</a>
						</div>
					</div>
				</div>
				<div class="list clearfix transition addPictrue">
				<div class="tu clearfix">
						<img src="" id="fimg7"/>
						<span></span>
						
						<div class="ycang clearfix">
							<samp class="opa8"></samp>
							<div class="nr clearfix">
								<!--注意：当下方li中添加class名为cur的时候为选中的时候样式-->
								<ul>
									<li class="box-s transition"onclick="addcollct()">收藏</li>
									<li class="box-s transition" onclick="addShoppingCar(7)">购物车</li>
								</ul>
							</div>								
						</div>
					</div>
					<div class="xia clearfix box-s">
						<p class="bt over" id="Aname7">
							尹毅画作
						</p>
						<div class="price clearfix">
						<span class="f1" id="price7">￥00.00</span>
							<a href="javaScript:;" onclick="shopping(7)" class="goumai fr ra3 transition shopping">立即购买</a>
						</div>
					</div>
				</div>
				<div class="list clearfix transition addPictrue">
				<div class="tu clearfix">
						<img src="" id="fimg8"/>
						<span></span>
						
						<div class="ycang clearfix">
							<samp class="opa8"></samp>
							<div class="nr clearfix">
								<!--注意：当下方li中添加class名为cur的时候为选中的时候样式-->
								<ul>
									<li class="box-s transition"onclick="addcollct()">收藏</li>
									<li class="box-s transition" onclick="addShoppingCar(8)">购物车</li>
								</ul>
							</div>								
						</div>
					</div>
					<div class="xia clearfix box-s">
						<p class="bt over" id="Aname8">
							尹毅画作
						</p>
						<div class="price clearfix">
							<span class="f1" id="price8">￥00.00</span>
							<a href="javaScript:;" onclick="shopping(8)" class="goumai fr ra3 transition shopping">立即购买</a>
						</div>
					</div>
				</div>
				<div class="list clearfix transition addPictrue">
				<div class="tu clearfix">
						<img src="" id="fimg9"/>
						<span></span>
						
						<div class="ycang clearfix">
							<samp class="opa8"></samp>
							<div class="nr clearfix">
								<!--注意：当下方li中添加class名为cur的时候为选中的时候样式-->
								<ul>
									<li class="box-s transition"onclick="addcollct()">收藏</li>
									<li class="box-s transition" onclick="addShoppingCar(9)">购物车</li>
								</ul>
							</div>								
						</div>
					</div>
					<div class="xia clearfix box-s">
						<p class="bt over" id="Aname9">
							尹毅画作
						</p>
						<div class="price clearfix">
							<span class="f1" id="price9">￥00.00</span>
							<a href="javaScript:;" onclick="shopping(9)" class="goumai fr ra3 transition shopping">立即购买</a>
						</div>
					</div>
				</div>
				<div class="list clearfix transition addPictrue">
				<div class="tu clearfix">
						<img src="" id="fimg10"/>
						<span></span>
						
						<div class="ycang clearfix">
							<samp class="opa8"></samp>
							<div class="nr clearfix">
								<!--注意：当下方li中添加class名为cur的时候为选中的时候样式-->
								<ul>
									<li class="box-s transition"onclick="addcollct()">收藏</li>
									<li class="box-s transition" onclick="addShoppingCar(10)">购物车</li>
								</ul>
							</div>								
						</div>
					</div>
					<div class="xia clearfix box-s">
						<p class="bt over" id="Aname10">
							尹毅画作
						</p>
						<div class="price clearfix">
							<span class="f1" id="price10">￥00.00</span>
							<a href="javaScript:;" onclick="shopping(10)" class="goumai fr ra3 transition shopping">立即购买</a>
						</div>
					</div>
				</div>
				<div class="list clearfix transition addPictrue">
				<div class="tu clearfix">
						<img src="" id="fimg11"/>
						<span></span>
						
						<div class="ycang clearfix">
							<samp class="opa8"></samp>
							<div class="nr clearfix">
								<!--注意：当下方li中添加class名为cur的时候为选中的时候样式-->
								<ul>
									<li class="box-s transition"onclick="addcollct()">收藏</li>
									<li class="box-s transition" onclick="addShoppingCar(11)">购物车</li>
								</ul>
							</div>								
						</div>
					</div>
					<div class="xia clearfix box-s">
						<p class="bt over" id="Aname11">
							尹毅画作
						</p>
						<div class="price clearfix">
							<span class="f1" id="price11">￥00.00</span>
							<a href="javaScript:;" onclick="shopping(11)" class="goumai fr ra3 transition shopping">立即购买</a>
						</div>
					</div>
				</div>
				<div class="list clearfix transition addPictrue">
				<div class="tu clearfix">
						<img src="" id="fimg12"/>
						<span></span>
						
						<div class="ycang clearfix">
							<samp class="opa8"></samp>
							<div class="nr clearfix">
								<!--注意：当下方li中添加class名为cur的时候为选中的时候样式-->
								<ul>
									<li class="box-s transition"onclick="addcollct()">收藏</li>
									<li class="box-s transition" onclick="addShoppingCar(12)">购物车</li>
								</ul>
							</div>								
						</div>
					</div>
					<div class="xia clearfix box-s">
						<p class="bt over" id="Aname12">
							尹毅画作
						</p>
						<div class="price clearfix">
							<span class="f1" id="price12">￥00.00</span>
							<a href="javaScript:;" onclick="shopping(12)" class="goumai fr ra3 transition shopping">立即购买</a>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--choice end-->
		
		<!--art star-->
		<div class="art clearfix">
			<div class="content clearfix box-s">
				<div class="art-ctent clearfix box-s">
					<div class="recom-tit clearfix">
						<p class="engtit ta-center">
							ART WRITER
						</p>
						<div class="middle clearfix">
							<span class="line"></span>
							<span class="wenzi">艺术家</span>
							<span class="line"></span>
						</div>
					</div>
					<div class="bottom clearfix box-s">
						<div class="scrollBox" style="margin:0 auto">
							<div class="ohbox" style="overflow:hidden; position:relative; width:968px">
								<ul class="piclist" id="ArtistInfo" style="width: 968px; left: 0px; position: relative; overflow: hidden; padding: 0px; margin: 0px;">
									
								</ul>
							</div>
							<div class="pageBtn">
								<span class="prev">&lt;</span>
								<span class="next">&gt;</span>
								<ul class="list"><li>0</li><li>1</li></ul>
							</div>
						</div>
					</div>		
					
				</div>
			</div>
		</div>
		<!--art end-->
			<jsp:include page="footer.jsp"/>
		
	</body>
	
	<script type="text/javascript">
	$(function(){
		recom();
		selectArtist();
		//dimSelectProInfo();
	})
	function recom(){
		fun={one:'f1'};
		ajaxfun({url:'${pageContext.request.contextPath }/recommened.do',funname:fun,type:'get'});
	}
	function selectArtist(){
		fun = {one:'selefun'};
		ajaxfun({url:'${pageContext.request.contextPath }/selectArtist.do',funname:fun,type:'get'});
	}
	/* var keyword;
	var  kw = dimSelectProInfo(keyword);
	var jsonkw = {"kw":""+kw+""};
	function dimSelectProInfo(){
		ajaxfun({url:'${pageContext.request.contextPath }/dimSelectProInfo.do',data:jsonkw,type:'get'});
	}
	function dimSelectProInfo(keyword){
		return keyword;
	} */
	function selefun(data){
		var arryinfo = [],strinfo;
		for(index in data.AINFO){
			arryinfo[index] = JSON.stringify(data.AINFO[index]);
		}
		strinfo = arryinfo.join('-');
		$.session.set('artistInfo',strinfo);
		//alert($.session.get('artistInfo'));
		for(index in data.AINFO){
			
			$('#ArtistInfo').prepend('<li style="float: left; width: 230px;">'+
					'<div class="list clearfix fl box-s transition">'+
					'<div class="tu clearfix box-s">'+
						'<img src="upload/aimg/'+
						''+data.AINFO[index].imgName+''+
						'"/>'+
					'</div>'+
					'<div class="ctent clearfix box-s">'+
						'<div class="shang clearfix">'+
							'<p class="over ta-center">'+
							''+data.AINFO[index].name+''+
							'</p>'+
						'</div>'+
						'<div class="xia clearfix">'+
							'<p style="height:245px;overflow: hidden;">'+
								''+data.AINFO[index].note+''+
								'<a href="#" class="more">'+
									'查看更多&gt;&gt;'+
								'</a>'+
							'</p>'+
						'</div>'+
					'</div>'+
				'</div>'+
			'</li>');
		}
	}
	
	var productInfo;
	function f1(data){
		var arryproinfo = [],strproinfo;
		for(index in data.PA){
			arryproinfo[index] = JSON.stringify(data.PA[index]);
		}
		strproinfo = arryproinfo.join('-');
		$.session.set('proInfo',strproinfo);
		//alert($.session.get('proInfo'));
		productInfo= data;
		var index = 0;
		for(index in data.PA){
			$('#fimg'+index+'').attr('src',"${pageContext.request.contextPath }/upload/product_img/"+data.PA[index].imgname+"");
			$('#Aname'+index+'').html(data.PA[index].name);
			$('#price'+index+'').html(data.PA[index].price);
			
		}
		
	}
	
	//获取用户编号
	var usesrcode = $('#usercode').html();
	
	//立即购买 将信息保存到cookie里
	function shopping(g){
		if($.trim(usesrcode) != ''){
			var obj = productInfo.PA[g];
			var newstrInfo = JSON.stringify(obj);
			$.cookie('newstrInfo',newstrInfo);
			location.href= '${pageContext.request.contextPath }/pro_detail.jsp';
		}else{
			alert("请先登陆");
		}
		
	}
	
	//接受要加入购物车的商品的信息
	function addShoppingCar(index){
	var product =  
		{  
		    'id': productInfo.PA[index].productnumber,        
		    'name': productInfo.PA[index].proname,  
		    'num':1,  
		    'price':productInfo.PA[index].price,
		    'imgname':productInfo.PA[index].imgname,
		    'qty':productInfo.PA[index].qty
		}; 
	
	if($.trim(usesrcode) != ''){
		//商品加入到购物车  
		cart.addproduct(product); 
		var productlist=cart.getproductlist();//取出购物车商品  
		$('#carnum').html(productlist.length);
	}else{
		alert("请先登陆");
	}
		
	}
	
	
	function addCollect(){
		alert(2);
	}
	
	
	
	</script>
	<script src="${pageContext.request.contextPath }/js/other.js" type="text/javascript" ></script>
</html>
